<#macro chipTree filepath prefix suffix>
	<@_templateList path='include'+filepath>
		<@_placeMetadata dir=filepath><#local metaDataMap=object/></@_placeMetadata>
		<#list list as a>
			<li>
				<#local path=filepath+'/'+a.fileName>
			<#if a.directory>
				<a href="javascript:;">${a.fileName} </a>
				<ul>
					<@chipTree path prefix suffix/>
				</ul>
			<#else>
				<a href="javascript:;" onclick="${editor!'cmsTemplateEditor'}.replaceSelection('${(prefix+path+suffix)?html?js_string} ${(metaDataMap[a.fileName].alias)?has_content?then('<#-- '+metaDataMap[a.fileName].alias+' -->','')?html?js_string}');$.pdialog.closeCurrent();return false;">
					${a.fileName} ${(metaDataMap[a.fileName].alias)?has_content?then('('+metaDataMap[a.fileName].alias?html+')','')}
				</a>
			</#if>
			</li>
		<#else>
			<li><a>空目录</a></li>
		</#list>
	</@_templateList>
</#macro>
<div class="pageFormContent">
	<ul class="tree treeFolder">
<@chipTree '' '<@_includePlace path="' '"/>'/>
	</ul>
</div>